package com.s63.appinfo.pojo;

public class AjaxResult {
    public static final int SUCCESS = 200;
    public static final int ERROR = 500;

    private int code = SUCCESS;
    private String msg;
    private Object data;

    public static AjaxResult ok() {
        return new AjaxResult();
    }

    public static AjaxResult ok(Object data) {
        AjaxResult ajaxResult = new AjaxResult();
        ajaxResult.setData(data);
        return ajaxResult;
    }

    public static AjaxResult error(String msg) {
        AjaxResult ajaxResult = new AjaxResult();
        ajaxResult.setMsg(msg);
        ajaxResult.setCode(ERROR);
        return ajaxResult;
    }
    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
